#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
using ll = long long;
const ll inf = 1e18;
ll a[N], pre[N];
set<ll> se;
int n;

ll query(int l, int r) {
    return pre[r] - pre[l - 1];
}
void Push(int l, int r){
    for(int i = l; i <= r; i++) se.insert(i);
}


void Case1(int l, int r) {
    ll ans1 = 0, ans2 = 0, mx, mn;
    mx = mn = pre[l - 1];
    for(int i = l; i <= r; i++) {
        ans1 = min(ans1, pre[i] - mx);
        ans2 = max(ans2, pre[i] - mn);
        mx = max(mx, pre[i]);
        mn = min(mn, pre[i]);
    }
    Push(ans1, ans2);
}

void Case2(int x) {
    ll lx, ln, rx, rn;
    lx = rx = -inf, ln = rn = inf;
    for(int i = x; i; i--) {
        ll val = query(i, x);
        lx = max(lx, val), ln = min(ln, val);
    }
    for(int i = x; i <= n; i++) {
        ll val = query(x, i);
        rx = max(rx, val), rn = min(rn, val);
    }
    Push(ln + rn - a[x], lx  + rx - a[x]);
    
}

void solve() {
    
    cin >> n;
    se.clear();
    for(int i = 1; i <= n; i++) cin >> a[i];
    for(int i = 1; i <= n; i++) pre[i] = pre[i - 1] + a[i];
    int p = 1;
    for(int i = 1; i <= n; i++){
        if(a[i] != -1 && a[i] != 1){
            p = i;
            break;
        }
    }
    Case1(1, p - 1), Case1(p + 1, n);
    Case2(p);
    cout << se.size() << '\n';
    for(ll x : se) {
        cout << x << ' ';
    }
    cout << '\n';
}

int main() {
    int t;
    cin >> t;
    while(t--) solve();
    return 0;
}